//
//  SPBaseFansTeamViewController.m
//  SmartCity
//
//  Created by LSP on 2017/5/15.
//  Copyright © 2017年 NRH. All rights reserved.
//

#import "SPBaseFansTeamViewController.h"

@interface SPBaseFansTeamViewController () <DZNEmptyDataSetSource, DZNEmptyDataSetDelegate>

@end

@implementation SPBaseFansTeamViewController {
    
}

- (void)dealloc {
    
}

- (void)viewDidLoad {
    if (!self.navigationItem.hidesBackButton) {
        [self setupNavigationBackItem];
    }
    [super viewDidLoad];
    // Do any additional setup after loading the view.
    self.navigationController.navigationBar.titleTextAttributes = @{NSForegroundColorAttributeName:[UIColor whiteColor]};
}

- (void)setupNavigationBackItem {
//    if (self.navigationItem.leftBarButtonItems.count) {
//        NSMutableArray *items = [self.navigationItem.leftBarButtonItems mutableCopy];
//
//        UIBarButtonItem *backItem =
//        [[UIBarButtonItem alloc] initWithImage:[UIImage imageNamed:@"fansteam_navi_back"]
//                                         style:(UIBarButtonItemStylePlain)
//                                        target:self
//                                        action:@selector(backViewController)];
//        backItem.tag = -999;
//        [items insertObject:backItem atIndex:0];
//        self.navigationItem.leftBarButtonItems = items;
//    }else{
        self.navigationItem.leftBarButtonItem =
        [[UIBarButtonItem alloc] initWithImage:[UIImage imageNamed:@"fansteam_navi_back"]
                                         style:(UIBarButtonItemStylePlain)
                                        target:self
                                        action:@selector(backViewController)];
        self.navigationItem.leftBarButtonItem.tag = -999;
    
//    }
}

- (UIStatusBarStyle)preferredStatusBarStyle {
    return UIStatusBarStyleLightContent;
}

//- (UIRectEdge)edgesForExtendedLayout {
//    return UIRectEdgeNone;
//}

#pragma mark - EmptyDataSet
- (BOOL)emptyDataSetShouldAllowScroll:(UIScrollView *)scrollView {
    return YES;
}
- (NSAttributedString *)titleForEmptyDataSet:(UIScrollView *)scrollView {
    return [[NSAttributedString alloc] initWithString:self.emptyTitle
                                           attributes:@{NSFontAttributeName: [UIFont regularPingFangOfSize:scaleBase375(14)],
                                                        NSForegroundColorAttributeName: [UIColor lightGrayColor]}];
}
- (CGFloat)verticalOffsetForEmptyDataSet:(UIScrollView *)scrollView {
    return -40;
}

- (NSString *)emptyTitle {
    if (!_emptyTitle) {
        return @"暂无数据~";
    }
    return _emptyTitle;
}

- (NSString *)emptyImageName {
    if (!_emptyImageName) {
        return @"blankpage_noorder";
    }
    return _emptyImageName;
}

- (UIImage *)imageForEmptyDataSet:(UIScrollView *)scrollView {
    return [UIImage imageNamed:@"blankpage_noorder"];
}

- (BOOL)hidesBottomBarWhenPushed {
    return YES;
}

@end
